﻿




using Hotpot.Infrastructure;
using Hotpot.Modules.Blogs.Models;
using Hotpot.Modules.Comments.Models;

namespace Hotpot.Modules.Blogs.Extensions
{
    public static class PostCommentExtensions
    {
        public static PostComment Apply(this PostComment comment, CommentInput input, User creator)
        {
            if (creator != null)
                return new PostComment(input.Body, comment.Created, creator, comment.CreatorIP, comment.CreatorUserAgent, comment.ID, comment.Language, comment.Modified, new PostCommentSmall(input.ParentID), comment.Post, comment.Slug, comment.State);
            else
                return new PostComment(input.Body, comment.Created, input.Creator, comment.CreatorIP, comment.CreatorUserAgent, comment.ID, comment.Language, comment.Modified, new PostCommentSmall(input.ParentID), comment.Post, comment.Slug, comment.State);
        }
    }
}
